home *** CD-ROM | disk | FTP | other *** search
/ Dr. Windows 3 / dr win3.zip / dr win3 / VISUALBA / INSPRO.ZIP / INSTLIB.PAS < prev    next >
Pascal/Delphi Source File  |  1993-01-02  |  15KB  |  297 lines

  1. Library Install;
  2.  
  3. {$D INSTLIB.DLL - ⌐ Copyright 1992 Robert Salesas, All Rights Reserved.}
  4. {$I-}
  5. {$M 1024,1024
  6. {
  7. ********************************************************************
  8. *                  EDI Install Pro for Windows                     *
  9. *                      Demo custom library                         *
  10. ********************************************************************
  11. *       Copyright 1992 Robert Salesas, All Rights Reserved         *
  12. ********************************************************************
  13. *      Version: 1.00             Author:  Robert Salesas           *
  14. *      Date:    13-Apr-1992      Changes: Original                 *
  15. *                                                                  *
  16. ********************************************************************
  17. }
  18.  
  19.  
  20. Uses WinTypes, WinProcs;
  21.  
  22.  
  23.  
  24. Const { Procedure call codes }
  25.   icm_Setup       = 10;         { Called before first dialog box.                }
  26.   icm_Setup2      = 20;         { Called after first dialog box.                 }
  27.   icm_Components  = 30;         { Called before components dialog box.           }
  28.   icm_Components2 = 40;         { Called after components dialog box.            }
  29.   icm_StartCopy   = 50;         { Called before files start getting copied.      }
  30.   icm_FileCopy    = 60;         { Called for each file that needs to get copied. }
  31.   icm_EndCopy     = 70;         { Called all files have been copied.             }
  32.   icm_PMGroup     = 80;         { Called before the PM group dialog box.         }
  33.   icm_ExtraStuff  = 90;         { Called once the installation is completed.     }
  34.   icm_EndDlgGood  = 100;        { Called before the last dialog box.             }
  35.   icm_EndDlgBad   = 110;        { Called before the last dialog box.             }
  36.   icm_EndInstall  = 120;        { Called before program terminates.              }
  37.  
  38.  
  39. Const
  40.   ir_Continue     = 0;          { Continue with normal execution.              }
  41.   ir_SkipSection  = 1;          { Skip this section.                           }
  42.   ir_AbortInstall = -1;         { Abort the installation with proper messages. }
  43.  
  44.  
  45.  
  46. {
  47.   Declaration:
  48.   ~~~~~~~~~~~~
  49.  
  50.   Function InstallDLLProc(Instance : THandle;  Code : Integer;  Src, Dest : PChar;
  51.                           Var Components : LongInt) : Integer;  Export;
  52.  
  53.   Description:
  54.   ~~~~~~~~~~~~
  55.  
  56.   Allows custom modification of the installation.  You may use or change the values
  57.   passed to your function.  By creating routines to handle special parts of your
  58.   installation (such as extra setup information or copying specially encoded files),
  59.   you can completely customize EDI Install Pro without having to write your own
  60.   installer.  There's very little (if anything) that can't be handled through a
  61.   custom DLL.  Since the DLL can be written in almost any language, you don't have
  62.   to learn to program in some strange "installer" language.
  63.  
  64.   To add a DLL to an installation script simply add the following under the [APPLICATION]
  65.   section, if it's not compressed:
  66.  
  67.       [APPLICATION]
  68.       Install DLL=INSTLIB.DLL N
  69.  
  70.   and if it is:
  71.  
  72.       [APPLICATION]
  73.       Install DLL=INSTLIB.DL$ Y
  74.  
  75.  
  76.   Parameters:
  77.   ~~~~~~~~~~~
  78.  
  79.   Instance      The instance handle of the install application.  You can use it to access
  80.                 resources stored in the EXE.  If you need to create new resources, add them
  81.                 to the DLL, not INSTALL.EXE.
  82.  
  83.   Code          Specifies when the procedure is getting called.  Each code allows you to
  84.                 perform certain actions.  Note that you don't have to handle every code, only
  85.                 the ones you want.  Simply return ir_Continue for any code you don't want to
  86.                 handle.
  87.  
  88.  
  89.                 icm_Setup           Src and Dest contain the default values for the
  90.                                     directories. Components are all turned on.
  91.  
  92.                                     You may modify the default values of Src and Dest.
  93.                                     Override (return ir_SkipSection) this section if you want
  94.                                     to include your own "Get destination" dialog box.
  95.  
  96.  
  97.                 icm_Setup2          Dest contains the value entered by the user.  Src and
  98.                                     Components are unchanged.
  99.  
  100.                                     You may modify the value of Dest that the user entered.
  101.                                     If you require extra setup information from the user, this
  102.                                     is the place to get it.  Pop up whatever dialogs you need.
  103.                                     You can store the information in the DLL, since it will
  104.                                     always be accessed by only one instance.
  105.  
  106.  
  107.                 icm_Components      Src, Dest and Components are unchanged.
  108.  
  109.                                     Override this section if you want to include your own
  110.                                     "Select Components" dialog box, or if you want to "force"
  111.                                     component selection.  For example you might want to use a
  112.                                     simple dialog box with radio buttons instead of the listbox.
  113.  
  114.  
  115.                 icm_Components2     Components contains the value selected by the user.
  116.                                     Src and Dest are unchanged.
  117.  
  118.                                     You may modify the value of Components that the user
  119.                                     entered.  If you require extra component or setup
  120.                                     information from the user, this is the place to get it.
  121.                                     Pop up whatever dialogs you need.  You can store the
  122.                                     information in the DLL, since it will always be
  123.                                     accessed by only one instance.
  124.  
  125.  
  126.                 icm_StartCopy       Src, Dest and Components are unchanged.
  127.  
  128.                                     This call is made before any files get copied.  Use this
  129.                                     call for any setup procedure you need if you use
  130.                                     icm_FileCopy.  For example, if you wanted to display
  131.                                     small messages on a separate as files get copied, you
  132.                                     would open the window in this call.
  133.  
  134.  
  135.                 icm_FileCopy        Src and Dest contain the SOURCE FILE PATH and the
  136.                                     DESTINATION FILE PATH.  This differs from all the other
  137.                                     calls.  Note the file name of Src and Dest might not
  138.                                     be the same.  For example, a compressed file could be
  139.                                     named FILE.EX$ as the source, and FILE.EXE as the
  140.                                     destination.  Components are unchanged.
  141.  
  142.                                     This call is made every time a file is about to be
  143.                                     copied.  Override this section if you want to display
  144.                                     messages in a window created by icm_startCopy or if you
  145.                                     want to use your own copying code.  For example, if you
  146.                                     encode your main .EXE, but not the rest of the files,
  147.                                     you can check to see if the current file is encoded, and
  148.                                     if it is, you decode it (and copy) and return
  149.                                     ir_SkipSection, and if it isn't encoded you ignore it and
  150.                                     return ir_Continue.  You can even do this:  decode the
  151.                                     source file to a temporary file (in Windows temp directory),
  152.                                     change Src to reflect this new source file, and return
  153.                                     ir_Continue.  EDI Install will then copy (decompressing if
  154.                                     needed) the file!  So you c